import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { createRouter, createWebHistory } from 'vue-router'
import App from './App.vue'
import './style.css'

// 导入页面组件
import Home from './views/Home.vue'
import AnnouncementsPage from './views/AnnouncementsPage.vue'
import AnnouncementDetailPage from './views/AnnouncementDetailPage.vue'
import BanListPage from './views/BanListPage.vue'
import CommandsPage from './views/CommandsPage.vue'
import DonationPage from './views/DonationPage.vue'
import DonorThanksPage from './views/DonorThanksPage.vue'
import AdminDashboard from './views/admin/AdminDashboard.vue'
import AnnouncementEditor from './views/admin/AnnouncementEditor.vue'
import DonorEditor from './views/admin/DonorEditor.vue'
import GalleryEditor from './views/admin/GalleryEditor.vue'
import PasswordEditor from './views/admin/PasswordEditor.vue'
import StaffEditor from './views/admin/StaffEditor.vue'

// 路由配置
const routes = [
  { path: '/', component: Home },
  { path: '/announcements', component: AnnouncementsPage },
  { path: '/announcements/:id', component: AnnouncementDetailPage },
  { path: '/banlist', component: BanListPage },
  { path: '/commands', component: CommandsPage },
  { path: '/donation', component: DonationPage },
  { path: '/donor-thanks', component: DonorThanksPage },
  { path: '/admin', component: AdminDashboard },
  { path: '/admin/announcements', component: AnnouncementEditor },
  { path: '/admin/donors', component: DonorEditor },
  { path: '/admin/gallery', component: GalleryEditor },
  { path: '/admin/password', component: PasswordEditor },
  { path: '/admin/staff', component: StaffEditor }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

const app = createApp(App)

app.use(ElementPlus)
app.use(router)
app.mount('#app') 